a={'TERMINATE':False,'VIEW_HANDS':False,'VIEW_EDITOR':False,'SLEEPED':True,'DATA':[]}
def set(key,val):
    a[key] = val
def get(key):
    if key in a:
        return a[key]
    else:
        return None
def switch(key):
    if key in a:
        a[key]=~a[key]
        return a[key]
    else:
        return None

def changeConfig(key=None, val=None):
    if key==None:
        # 默认配置
        return
    if type(key)==dict:
        if "VIEW_HANDS" in key:
            set("VIEW_HANDS",key["VIEW_HANDS"])
        if "VIEW_EDITOR" in key:
            set("VIEW_EDITOR",key["VIEW_EDITOR"])
        return
    # set(key, val)
    if key=="VIEW_HANDS":
        set("VIEW_HANDS", bool(val) if val!=None else False)
    if key=="VIEW_EDITOR":
        set("VIEW_EDITOR", bool(val) if val!=None else False)
